package com.server.questionbank.snframe.domain.User;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 表名：T_user
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("T_user")
public class TUser {
    //type = IdType.AUTO用了这一条，insert后会自动回填自增值
    @TableId(type = IdType.AUTO)
    private Long userId;

    private String phoneNumber;

    private String passwordHash;

    private String userName;

    private String nickName;

    private String avatar;

    private String avatarPath;

    private String userEmail;

    private String supermanager;

    @TableField(fill = FieldFill.INSERT)
    private String regTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updateTime;

    private String updateBy;

    private String resume;

    public void setUserId(Long userId) {
        this.userId = userId;
        avatarPath = "/users/overt/avatar?userId=" + userId;
    }
}